package com.kristin.spi;

import com.kristin.driver.DBDriver;
import java.util.Iterator;
import java.util.ServiceLoader;

public class DbTest {

    public static void main(String[] args) {
        ServiceLoader<DBDriver> services = ServiceLoader.load(DBDriver.class);
        Iterator<DBDriver> spiServiceIter = services.iterator();
        while(spiServiceIter.hasNext()) {
            DBDriver next=  spiServiceIter.next();
            next.loadDriver();
        }
    }

}
